package cn.sccl.dirms.dev.model;

import cn.sccl.common.exception.BusinessException;
import cn.sccl.common.model.BaseModel;

/**
* 
* 数据库表 t_dev_data 的实体对象
* Created by liupan on 2017-06-25.
*/
public class DataSource extends BaseModel{
/**
*表名
*/
public final static String TABLE_NAME ="t_dev_data";

    private java.lang.String dsNo;//数据编号：唯一！
    private java.lang.String dsType;//数据项类型：数据库/rest服务
    private java.lang.String dsName;//数据项名称
    private java.lang.String valStr;//取数字符串：sql/url
    private java.lang.String valMethod;//取值方法：get/post/。。。
    private java.lang.String valType;//值格式：rest（json/xml）
    private java.lang.String params;//入参
    private java.lang.String classify;//

    public void setDsNo(java.lang.String dsNo){
    this.dsNo = dsNo;
    }

        public java.lang.String getDsNo(){
    return this.dsNo;
    }
    public void setDsType(java.lang.String dsType){
    this.dsType = dsType;
    }

        public java.lang.String getDsType(){
    return this.dsType;
    }
    public void setDsName(java.lang.String dsName){
    this.dsName = dsName;
    }

        public java.lang.String getDsName(){
    return this.dsName;
    }
    public void setValStr(java.lang.String valStr){
    this.valStr = valStr;
    }

        public java.lang.String getValStr(){
    return this.valStr;
    }
    public void setValMethod(java.lang.String valMethod){
    this.valMethod = valMethod;
    }

        public java.lang.String getValMethod(){
    return this.valMethod;
    }
    public void setValType(java.lang.String valType){
    this.valType = valType;
    }

        public java.lang.String getValType(){
    return this.valType;
    }
    public void setParams(java.lang.String params){
    this.params = params;
    }

        public java.lang.String getParams(){
    return this.params;
    }
    public void setClassify(java.lang.String classify){
    this.classify = classify;
    }

        public java.lang.String getClassify(){
    return this.classify;
    }

/**
* clone一个对象。
* @param cls 需要克隆的对象类型，只能是当前类的子类
* @param
<T>
    * @return
    * @throws IllegalAccessException
    * @throws InstantiationException
    */
    public
    <T extends DataSource> T clone(Class
        <T> cls) {
            try {
            T t = cls.newInstance();
            t.setId(this.
            getId());
            t.setDsNo(this.
            getDsNo());
            t.setDsType(this.
            getDsType());
            t.setDsName(this.
            getDsName());
            t.setValStr(this.
            getValStr());
            t.setValMethod(this.
            getValMethod());
            t.setValType(this.
            getValType());
            t.setParams(this.
            getParams());
            t.setCreateTime(this.
            getCreateTime());
            t.setUpdateTime(this.
            getUpdateTime());
            t.setDeleteFlag(this.
            isDeleteFlag());
            t.setClassify(this.
            getClassify());
            return t;
            } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException("对象克隆失败，请克隆的目标对象是否具有无参的构造函数。", e.getCause());
            }
            }
            }